package com.huo.qq.common;

import java.util.ArrayList;
import java.util.List;

/**
 * <p>Title: qq状态表</p>
 * <p>Description: </p>
 * @author Huoyan
 * @version 1.0
 * 2013-4-4
 */
public class States {
	public final static String NOLOGIN = "未登录";
	public final static String LOGINED = "已登录";
	public final static String PASSWORD_WRONG = "密码错误";
	public final static String NET_ERROR = "网络异常";
	public final static String LOGIN_FAILED = "登录失败";
	public final static String DISABLEED = "禁止登录";
	private static List<String> stlist = null;
	
	//状态值与中文对应关系
	public static String getState(int i){
		String res;
		switch (i) {
		case 0:
			res = NOLOGIN;
			break;
		case 1:
			res = LOGINED;
			break;
		case 2:
			res = PASSWORD_WRONG;
			break;
		case 3:
			res = NET_ERROR;
			break;
		case 4:
			res = LOGIN_FAILED;
			break;
		case 5:
			res = DISABLEED;
		default:
			res = NOLOGIN;
			break;
		}
		return res;
	}
	
	public static List<String> getStateList(){
		if(stlist == null || stlist.size() <= 0){
			stlist = new ArrayList<String>();
			stlist.add(NOLOGIN);
			stlist.add(LOGINED);
			stlist.add(PASSWORD_WRONG);
			stlist.add(NET_ERROR);
			stlist.add(LOGIN_FAILED);
			stlist.add(DISABLEED);
			return stlist;
		} else {
			return stlist;
		}
	}
}
